/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: #f5f7fb;
    color: #333;
    line-height: 1.5;
}

/* 后台布局 */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background-color: #343a40;
    color: #fff;
    transition: all 0.3s;
    z-index: 1000;
}

.sidebar-collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 20px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #2c3136;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    font-size: 18px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
}

.sidebar-menu {
    padding: 15px 0;
}

.sidebar-menu .nav-item {
    margin-bottom: 5px;
}

.sidebar-menu .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 20px;
    border-radius: 0;
    transition: all 0.3s;
    position: relative;
    display: flex;
    align-items: center;
}

.sidebar-menu .nav-link i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.sidebar-menu .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-menu .nav-link.active {
    color: #fff;
    background-color: #3498db;
}

.sidebar-collapsed .sidebar-menu .nav-link span {
    display: none;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* 顶部导航栏 */
.top-bar {
    height: 70px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    z-index: 100;
}

.search-box {
    display: flex;
    align-items: center;
    width: 300px;
}

.search-box input {
    border-right: none;
    border-radius: 4px 0 0 4px;
}

.search-box button {
    border-radius: 0 4px 4px 0;
    border: 1px solid #ced4da;
    border-left: none;
    background-color: #fff;
    color: #6c757d;
}

.top-right {
    display: flex;
    align-items: center;
}

.notifications {
    position: relative;
    margin-right: 20px;
}

.notifications .dropdown-toggle {
    color: #6c757d;
    text-decoration: none;
    font-size: 20px;
}

.notifications .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 10px;
    padding: 3px 5px;
}

.user-profile {
    position: relative;
}

.user-profile .dropdown-toggle {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 10px;
}

.username {
    font-weight: 500;
}

.notification-item {
    display: flex;
    align-items: center;
    padding: 5px 0;
}

.notification-item .icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-right: 10px;
}

.notification-item .content {
    flex: 1;
}

.notification-item .content p {
    margin: 0;
    font-size: 14px;
}

.notification-item .content small {
    color: #6c757d;
    font-size: 12px;
}

/* 内容区域 */
.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.page-header {
    margin-bottom: 20px;
}

.page-header h2 {
    margin-bottom: 5px;
    font-size: 24px;
}

/* 统计卡片 */
.stats-cards {
    margin-bottom: 20px;
}

.stats-card {
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-icon {
    font-size: 30px;
    margin-bottom: 15px;
}

.stats-info h5 {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
}

.stats-info h3 {
    margin: 5px 0 15px;
    font-size: 28px;
    font-weight: 600;
}

.stats-progress {
    margin-top: auto;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header .card-title {
    margin: 0;
    font-weight: 600;
}

.card-header .card-actions {
    display: flex;
    align-items: center;
}

.card-body {
    padding: 20px;
}

/* 表格样式 */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: #6c757d;
    border-top: none;
    background-color: #f9fafb;
}

.table td {
    vertical-align: middle;
}

/* 分页样式 */
.pagination {
    margin-top: 20px;
    margin-bottom: 0;
}

/* 响应式调整 */
@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        left: -250px;
        height: 100%;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* 图表容器 */
.chart-container {
    position: relative;
    min-height: 300px;
}

/* 表单样式优化 */
.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.15);
    border-color: #86b7fe;
}

/* 按钮悬停效果 */
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 徽章样式 */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* 图表占位符样式 */
.chart-placeholder {
    background-color: #f8f9fa;
    border-radius: 5px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

/* 搜索和筛选区域 */
.search-field, .filter-options {
    max-width: 300px;
}

/* Tab内容样式 */
.tab-pane {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 进度条统计 */
.progress-stats {
    padding: 10px 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 14px;
}

.progress {
    height: 8px;
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.05);
}

.progress-bar {
    border-radius: 10px;
}

/* 通知列表 */
.notification-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-list .notification-item {
    transition: background-color 0.3s;
}

.notification-list .notification-item:hover {
    background-color: #f8f9fa;
}

.notification-list .icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 全局通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 300px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    padding: 15px;
    display: flex;
    align-items: center;
    z-index: 1050;
    transform: translateX(110%);
    transition: transform 0.3s ease-in-out;
    opacity: 0.9;
}

.notification.show {
    transform: translateX(0);
}

.notification-icon {
    margin-right: 15px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.notification-success .notification-icon {
    background-color: #2ecc71;
    color: #fff;
}

.notification-warning .notification-icon {
    background-color: #f1c40f;
    color: #fff;
}

.notification-danger .notification-icon {
    background-color: #e74c3c;
    color: #fff;
}

.notification-info .notification-icon {
    background-color: #3498db;
    color: #fff;
}

.notification-content {
    flex: 1;
}

.notification-content p {
    margin: 0;
    font-size: 14px;
}

.notification-close {
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
}

/* 控制面板图表增强 */
.chart-container {
    position: relative;
    min-height: 300px;
    background-color: #fff;
    border-radius: 4px;
    padding: 10px;
}

/* 按钮组样式增强 */
.btn-group .btn-outline-secondary {
    transition: all 0.3s;
}

.btn-group .btn-outline-secondary.active {
    background-color: #3498db;
    border-color: #3498db;
    color: #fff;
}

/* 表单样式优化 */
.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.15);
    border-color: #86b7fe;
}

/* 按钮悬停效果 */
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 徽章样式 */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Tab内容样式 */
.tab-pane {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 快捷操作 */
.shortcut-item {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    cursor: pointer;
    height: 100%;
}

.shortcut-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.shortcut-item .icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.shortcut-item h6 {
    margin-bottom: 5px;
    font-weight: 600;
}

.shortcut-item p {
    margin-bottom: 0;
}

/* 图片上传预览 */
.image-preview-container {
    width: 100%;
    height: 160px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.image-preview-placeholder {
    text-align: center;
    color: #6c757d;
}

.image-preview-placeholder i {
    font-size: 40px;
    margin-bottom: 10px;
}

.image-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.edit-image-preview {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
    text-align: center;
    background-color: #f8f9fa;
}

.edit-image-preview img {
    max-width: 100%;
    max-height: 240px;
}

/* 商品列表样式 */
.table .img-thumbnail {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

/* 分类标签 */
.category-tags .badge {
    font-size: 0.9rem;
    font-weight: normal;
}

.btn-close-sm {
    font-size: 0.5rem;
}

/* 表单样式优化 */
.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.15);
    border-color: #86b7fe;
}

/* Tab内容样式 */
.tab-pane {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} 